<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>全所电子归档</title>
		<meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="../../layuiadmin/layui-v2.5.5/layui/css/layui.css" media="all" type="text/css">
  <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
	</head>
	<style>
		.selectrecord{
			background-image: url(../../images/record/2019-11-01_154437.png);
			height: 33px;
			width: 568px;
			text-align: left;
		}
		/*下拉按钮样式**/
        .down-panel{
            padding: 0;
            z-index: 100;
            overflow:visible;
        }
        .down-panel .layui-select-title{
            padding-right:30px;
            padding-left:10px;
            overflow:visible;
        }
        .down-panel dl{
            color: #000;
            top: 30px;
            font-size: 14px;
        }
        .down-panel .layui-select-title i{
            border-top-color:#fff;
        }
        .down-panel:hover{
            opacity:1 !important;
            filter:alpha(opacity=100) !important;
            color:#fff
        }
        .layui-anim-upbit{
            top: 100% !important;
            z-index: 999999 !important;
        }
        .layui-anim-upbit dd {
            text-align: left;
        }
        .over-hover{
            overflow: visible; z-index: 9999;
        }
        .layui-select-title{
            background-color: #008FBF;
        }
        .layui-table-box{
            overflow: visible;!important;
        }
        .layui-table-body{
            overflow: visible;!important;
        }
	</style>
	<body>
<form method="post" id="form1" enctype="multipart/form-data">
	<div class="layui-fluid">
		<div class="layui-card">
			<div class="layui-form layui-card-header layuiadmin-card-header-auto">
				<!--我的电子文档-->
		    	<div class="layui-form-item">
		    		<div class="layui-inline">
		            	<!--客户名称查询条件-->
		            	<label class="layui-form-label"></label>
			            <div class="layui-input-inline">
			              <input type="text" name="client_name" id="clientname"  autocomplete="off" class="layui-input">
			            </div>
         			</div>
         			
         			<div class="layui-inline">
			            <div class="layui-input-inline">
			              <select id="stateclient" style="width: 100px;height: 37px;">
			                <option value="1">案号搜索</option>
							<option value="2">上传人搜索</option>
							<option value="3">归档文件搜索</option>
			              </select>
			            </div>
			        </div>
					<div class="layui-inline">
			            <div class="layui-input-inline">
			              <input type="button" id="selec" value="检索" data-type="reload" class="layui-btn layui-btn-normal">
			            </div>
         			</div>
       			</div> 
       		</div>
       		<div class="layui-card-body">
	         			<table id="recordall" lay-filter="test"></table>
	         			<div id="laypage"></div>
	        </div>
        
		</div>
	</div>
	<!--案件归档-->
</form>
<script src="../../layuiadmin/layui-v2.5.5/layui/layui.js" type="text/javascript"></script>
<script src="../../layuiadmin/jquery/jquery.min.js" type="text/javascript"></script>
<script src="../../layuiadmin/js/system/jquery.cookie.js"></script>
<script type="text/javascript">
	    	function createrFormat(o){
                	return o;
   			}
	    	var msg=null;
			$(function(){
				var client = $("#clientname").val();
				var state = $("#stateclient").val();
				layui.use(['table','form',], function(){
					var table = layui.table,
					 form = layui.form; 
			        
			        table.render({
					    elem: '#recordall'
					    ,url: 'http://localhost:8080/record/listrecordall' //数据接口
					    ,method:'post'
					    ,cols: [[ //表头
					       {type:'checkbox',title:'全选', fixed: 'left',width:'16%'}
					      ,{field: 'recordId', title: '档案号', fixed: 'left', width:'14%'}
					      ,{templet:'<div>{{createrFormat(d.caseId.version)}}<\/div>',title: '案件号', sort: true,width:'18%'}
					      ,{field: 'archivefile', title: '归档文件', width:'17%'}
					      ,{templet:'<div>{{createrFormat(d.empId.empName)}}<\/div>', title: '上传人',width:'16%'}
					      ,{templet:'<div>{{createrFormat(d.turnovertime)}}<\/div>', title: '最后上传时间',width:'19%', sort: true}
					    ]]
					    ,id:"records"
					    ,page: true
					    ,where:{
					    	stateclient:state,
					    	casetext:client
					    }
					  });
					table.on('checkbox(test)', function(obj){
						  if(obj.checked==true){
						  	if(obj.type=="all"){
						  		alert("不可全选！");
						  		var state = $("#stateclient").val();
			  					var casetext1 = $("#casetext").val();
						  		table.reload('clients',{
			                        page: {
			                            curr: 1 //重新从第 1 页开始
			                        }
			                        ,where: {
			                            stateclient:state,
					    				casetext:casetext1
			                        }
                        });
						  	}else{
						  		msg= obj.data.recordId;
						  		window.parent.$("input[id='record1'").val(msg);
						  		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
								parent.layer.close(index); //再执行关闭  
						  		
						  	}
						  }else{
						  }
					});  
					var $ = layui.$, active = {
		                reload: function(){
		                	var state = $("#stateclient").val();
		  					var casetext1 = $("#client").val();
		                    //执行重载
		                    table.reload('records', {
		                        page: {
		                            curr: 1 //重新从第 1 页开始
		                        }
		                        ,where: {
		                            stateclient:state,
				    				casetext:client
		                        }
		                    });
	               		}
	           		 };
				  	 	$('#selec').on('click', function () {
				  	 		client = $("input[name='client_name']").val();
						    var type = $(this).data('type');
						    active[type] ? active[type].call(this) : '';
						});
				  	 	
			 		
				});
			});
			
	   	</script>
	</body>
</html>
